<?php
//initialize the user session
//name prefixes are important
/*
 * remember
 * C_FW = system constants
 * always define framework constants
 * define system variables with $fw
 * configuration variables are prefixed with $fw_conf
 * 
 * for global class objects for usage remember to use 
 * this means framework object
 * $fw_o_
 * 
 * objects or classes = $o_
 * strings $s_
 * integers $i_
 * float $f_
 * boolean $b_
 * double $d_
 * array $arr_
 * file $f_
 * file image $img_ 
 */

//front-end related files
//back-end related files
$fw_backendPackage = 'backend';
$fw_frontendPackage = 'frontend';
//name of the folder where the custom files are kept
$fw_customPackage = 'custom';
//name of the folder where the framework files are kept
$fw_fwPackage = 'framework';
/*
 * note: str_replace("\\", "/", string) replaces all occurences of the forward slash to backslash
 */

//filename of this index file
define('C_FW_INDEX', pathinfo(__FILE__, PATHINFO_BASENAME));
//absolute path of the index page for later reference
define('C_FW_TRUEABSPATH', __FILE__);

//replace the forward slashes \ with back slashes

//absolute path to the folder hierarchy minus the index page name
define('C_FW_ABSPATH', str_replace("\\", "/", str_replace(C_FW_INDEX, '',  C_FW_TRUEABSPATH)));

//the framework package
define('C_FW_fwPackage', str_replace("\\", "/", C_FW_ABSPATH.$fw_backendPackage . '/' . $fw_fwPackage) . '/');

//the custom package
define('C_FW_customPackage', str_replace("\\", "/", C_FW_ABSPATH . $fw_backendPackage . '/' . $fw_customPackage) . '/');

//define the frontend package
define('C_FW_frontendPackage', str_replace("\\", "/",   $fw_frontendPackage . '/'));
//echo C_FW_ABSPATH.'<br>'.C_FW_fwPackage.'<br>'.C_FW_customPackage;

//require the main application file
require_once C_FW_fwPackage . 'application/application.php';
?>